/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.cip.esymons.eventos.be;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Transient;
import org.cip.esymons.general.be.PersonaNatural;

/**
 *
 * @author oscar
 */
@Entity
@Table(name = "eca_instructor_evento")
@NamedQueries({@NamedQuery(name = "InstructorEvento.findAll", query = "SELECT i FROM InstructorEvento i"), @NamedQuery(name = "InstructorEvento.findByIneCodigo", query = "SELECT i FROM InstructorEvento i WHERE i.ineCodigo = :ineCodigo"), @NamedQuery(name = "InstructorEvento.findByInenroHoras", query = "SELECT i FROM InstructorEvento i WHERE i.inenroHoras = :inenroHoras")})
public class InstructorEvento implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "ine_codigo")
    private Integer ineCodigo;
    @Column(name = "ine_nroHoras")
    private Integer inenroHoras;
    @Basic(optional = false)
    @Column(name = "ine_prioridad")
    private Boolean inePrioridad;
    @JoinColumn(name = "per_codigo", referencedColumnName = "per_codigo")
    @ManyToOne(optional = false, fetch = FetchType.LAZY)
    private PersonaNatural perCodigo;
    @JoinColumn(name = "pre_codigo", referencedColumnName = "pre_codigo")
    @ManyToOne(optional = false, fetch = FetchType.LAZY)
    private Preevento preCodigo;
    @Column(name = "ine_costoHora")
    private double inecostoHora;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "ineCodigo", fetch = FetchType.LAZY)
    private List<InstructorModulo> instructorModuloCollection;
    @Transient
    private boolean registrado;

    public InstructorEvento() {
    }

    public InstructorEvento(Integer ineCodigo) {
        this.ineCodigo = ineCodigo;
    }

    public Integer getIneCodigo() {
        return ineCodigo;
    }
    public void setIneCodigo(Integer ineCodigo) {
        this.ineCodigo = ineCodigo;
    }

    public boolean isRegistrado() {
        return registrado;
    }
    public void setRegistrado(boolean registrado) {
        this.registrado = registrado;
    }

    public Integer getInenroHoras() {
        return inenroHoras;
    }
    public void setInenroHoras(Integer inenroHoras) {
        this.inenroHoras = inenroHoras;
    }

    public Boolean getInePrioridad() {
        return inePrioridad;
    }
    public void setInePrioridad(Boolean inePrioridad) {
        this.inePrioridad = inePrioridad;
    }

    public PersonaNatural getPerCodigo() {
        return perCodigo;
    }
    public void setPerCodigo(PersonaNatural perCodigo) {
        this.perCodigo = perCodigo;
    }

    public Preevento getPreCodigo() {
        return preCodigo;
    }
    public void setPreCodigo(Preevento preCodigo) {
        this.preCodigo = preCodigo;
    }

    public List<InstructorModulo> getInstructorModuloCollection() {
        return instructorModuloCollection;
    }
    public void setInstructorModuloCollection(List<InstructorModulo> instructorModuloCollection) {
        this.instructorModuloCollection = instructorModuloCollection;
    }

    public double getInecostoHora() {
        return inecostoHora;
    }
    public void setInecostoHora(double inecostoHora) {
        this.inecostoHora = inecostoHora;
    }



    @Override
    public int hashCode() {
        int hash = 0;
        hash += (ineCodigo != null ? ineCodigo.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof InstructorEvento)) {
            return false;
        }
        InstructorEvento other = (InstructorEvento) object;
        if ((this.ineCodigo == null && other.ineCodigo != null) || (this.ineCodigo != null && !this.ineCodigo.equals(other.ineCodigo))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "org.cip.esymons.eventos.be.InstructorEvento[ineCodigo=" + ineCodigo + "]";
    }


}
